package com.demo.boss.common.convert;


import com.demo.boss.entity.PayProduct;
import com.demo.boss.models.vo.PayProductVo;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.MappingConstants;
import org.mapstruct.Mappings;

import java.util.List;

@Mapper(componentModel = MappingConstants.ComponentModel.SPRING,uses = {MapperHelper.class})
public interface ProductConvert {
    @Mappings({
            @Mapping(source = "productCode",target = "productCode"),
            @Mapping(source = "productName",target = "productName"),
            @Mapping(source = "status",target = "status",qualifiedByName = "translateStatus"),
            @Mapping(source = "editTime",target = "editTime",dateFormat = "yyyy-MM-dd HH:mm")

    })
    PayProductVo mapProductVo(PayProduct payProduct);
    List<PayProductVo> convertListPayProductVo(List<PayProduct> productList);
}
